<template>
  <DashboardPage
    db-name="perfintDev"
    table="ruby"
    persistent-id="ruby_product_dashboard"
    :with-installer="false"
    initial-machine="Linux EC2 C6id.8xlarge (32 vCPU Xeon, 64 GB)"
    :charts="charts"
  >
    <section>
      <GroupProjectsChart
        v-for="chart in charts"
        :key="chart.definition.label"
        :label="chart.definition.label"
        :measure="chart.definition.measure"
        :projects="chart.projects"
      />
    </section>
  </DashboardPage>
</template>

<script setup lang="ts">
import { ChartDefinition, combineCharts } from "../charts/DashboardCharts"
import GroupProjectsChart from "../charts/GroupProjectsChart.vue"
import DashboardPage from "../common/DashboardPage.vue"

const chartsDeclaration: ChartDefinition[] = [
  {
    labels: ["Indexing Time"],
    measures: ["indexingTimeWithoutPauses"],
    projects: [
      "diaspora-project-test/indexing",
      "gem-rbs-collection-indexing-test/indexing",
      "gitlab-project-test/indexing",
      "redmine-project-test/indexing",
      "markus-project-test/indexing",
      "mastodon-project-test/indexing",
      "rubygems-org-project-test/indexing",
    ],
    aliases: ["Diaspora", "RBS Collection", "Gitlab", "Redmine", "Markus", "Mastodon", "RubyGems.org"],
  },
  {
    labels: ["FirstCodeAnalysis"],
    measures: ["firstCodeAnalysis"],
    projects: [
      "GitLab/typing/lambda_body_in_class",
      "RUBY-26170/typing",
      "RUBY-29334/typing",
      "RUBY-29542/typing",
      "GitLab/typing/typing/user/method",
      "GitLab/typing/enter/parser/method",
      "GitLab/typing/enter/structure/inside_query",
      "GitLab/typing/enter/project_spec/describe",
      "GitLab/typing/enter/project_controller/class",
      "GitLab/typing/enter/mr_mail/class",
      "GitLab/typing/enter/user_show_view/before_div",
      "GitLab/typing/enter/routes_project/top",
      "GitLab/typing/enter/emojis_json/map",
      "diaspora-project-test/completion/constant",
      "gitlab-project-test/completion/constant",
      "redmine-project-test/completion/constant",
      "diaspora-project-test/completion/exceptions",
      "gitlab-project-test/completion/exceptions",
      "redmine-project-test/completion/exceptions",
      "diaspora-project-test/completion/exceptions-prefix",
      "gitlab-project-test/completion/exceptions-prefix",
      "redmine-project-test/completion/exceptions-prefix",
      "diaspora-project-test/completion/localization",
      "gitlab-project-test/completion/localization",
      "redmine-project-test/completion/localization",
      "diaspora-project-test/completion/method",
      "gitlab-project-test/completion/method",
      "redmine-project-test/completion/method",
      "diaspora-project-test/completion/qualified",
      "gitlab-project-test/completion/qualified",
      "redmine-project-test/completion/qualified",
      "RUBY-23764-Case1/ruby-23764-findusages-case1",
      "RUBY-23764-Case2/ruby-23764-findusages-case2",
      "gitlab-find-usages/ruby-23764-findusages-case1",
      "gitlab-find-usages/ruby-23764-findusages-case2",
      "RUBY-32357/module",
      "RUBY-32357/method",
      "RUBY-32357/singleton-method",
      "RUBY-32357/instance-variable",
      "RUBY-32357/class-variable",
      "RUBY-32357/global-variable",
      "RUBY-32357/delegate-method",
      "gitlab-find-usages/module",
      "gitlab-find-usages/method",
      "gitlab-find-usages/singleton-method",
      "gitlab-find-usages/instance-variable",
      "gitlab-find-usages/class-variable",
      "gitlab-find-usages/global-variable",
      "gitlab-find-usages/delegate-method",
      "mastodon-find-usages/i18n-key",
    ],
    aliases: [
      "Project Model (GL)",
      "swagger_helper.rb",
      "activerecord-generated.rbs",
      "User Model Spec (Rails Sample)",
      "User Model (GL)",
      "Ruby Parser",
      "structure.sql (GL)",
      "Project Model Spec (GL)",
      "Project Controller (GL)",
      "MR Mail (GL)",
      "Users View Haml (GL)",
      "Project Routes (GL)",
      "Emojis.json (GL)",
      "Message Model (DI)",
      "Clusters Controller (GL)",
      "Time Entry Activity Model (RM)",
      "Admins Controller (DI)",
      "Admin App Controller (GL)",
      "Account Controller (RM)",
      "Process Photo Worker (DI)",
      "Build Trace Chunk Model (GL)",
      "App Controller (RM)",
      "Admin Pods View Haml (DI)",
      "Admin Locale View Haml (GL)",
      "Time Entries Import View (RM)",
      "Conversation Visibility Model (DI)",
      "Epic Move List (GL)",
      "Auto Completes Controller (RM)",
      "Contacts Controller Spec (DI)",
      "Environment Entity Serializer (GL)",
      "Admin Info View Erb (RM)",
      "Users Spec Factory (GL)",
      "File Collection Spec (GL)",
      "Users Spec Factory (GL2)",
      "File Collection Spec (GL2)",
      "GitLab Routing Helper (GL)",
      "Todo Model (GL)",
      "GitLab Script (GL)",
      "Labels Finder (GL)",
      "Epics Swimlanes Drag Drop Spec (GL)",
      "Feature Flag Script (GL)",
      "Framework Registry Finder (GL)",
      "GitLab Routing Helper (GL)",
      "Todo Model (GL)",
      "GitLab Script (GL)",
      "Labels Finder (GL)",
      "Epics Swimlanes Drag Drop Spec (GL)",
      "Feature Flag Script (GL)",
      "Framework Registry Finder (GL)",
      "Locale File (MA)",
    ],
  },
  {
    labels: ["Completion (Diaspora)"],
    measures: ["completion#mean_value"],
    projects: [
      "diaspora-project-test/completion/routes",
      "diaspora-project-test/completion/exceptions",
      "diaspora-project-test/completion/localization",
      "diaspora-project-test/completion/constant",
      "diaspora-project-test/completion/exceptions-prefix",
      "diaspora-project-test/completion/method",
      "diaspora-project-test/completion/qualified",
    ],
    aliases: ["Routes", "Exceptions", "I18n#t", "Constant", "Exceptions (prefix)", "Method", "Qualified"],
  },
  {
    labels: ["Completion (GitLab)"],
    measures: ["completion#mean_value"],
    projects: [
      "gitlab-project-test/completion/routes",
      "gitlab-project-test/completion/exceptions",
      "gitlab-project-test/completion/localization",
      "gitlab-project-test/completion/constant",
      "gitlab-project-test/completion/exceptions-prefix",
      "gitlab-project-test/completion/method",
      "gitlab-project-test/completion/qualified",
    ],
    aliases: ["Routes", "Exceptions", "I18n#t", "Constant", "Exceptions (prefix)", "Method", "Qualified"],
  },
  {
    labels: ["Completion (Redmine)"],
    measures: ["completion#mean_value"],
    projects: [
      "redmine-project-test/completion/routes",
      "redmine-project-test/completion/exceptions",
      "redmine-project-test/completion/localization",
      "redmine-project-test/completion/constant",
      "redmine-project-test/completion/exceptions-prefix",
      "redmine-project-test/completion/method",
      "redmine-project-test/completion/qualified",
    ],
    aliases: ["Routes", "Exceptions", "I18n#t", "Constant", "Exceptions (prefix)", "Method", "Qualified"],
  },
  {
    labels: ["SearchEverywhere"],
    measures: ["searchEverywhere"],
    projects: [],
  },
  {
    labels: ["Typing: Average AWT Delay"],
    measures: ["test#average_awt_delay"],
    projects: [
      "RUBY-26170/typing",
      "RUBY-29334/typing",
      "GitLab/typing/typing/user/method",
      "GitLab/typing/typing/user/class",
      "GitLab/typing/typing/user/lambda",
      "GitLab/typing/typing/parser/method",
      "GitLab/typing/typing/parser/class",
      "GitLab/typing/typing/parser/class_array",
      "GitLab/typing/typing/parser/class_assoc",
      "GitLab/typing/typing/parser/newline_class_body",
      "GitLab/typing/typing/parser/newline_class_array",
      "GitLab/typing/typing/parser/newline_class_method",
    ],
    aliases: [
      "Ruby assoc with map",
      "RBS method",
      "User Model Method (GL)",
      "User Model Class (GL)",
      "User Model Lambda (GL)",
      "Parser Method",
      "Parser Class",
      "Parser Array",
      "Parser Assoc",
      "Parser Class (new line)",
      "Parser Array (new line)",
      "Parser Method (new line)",
    ],
  },
  {
    labels: ["Typing: Total Time"],
    measures: ["typing"],
    projects: [
      "RUBY-26170/typing",
      "RUBY-29334/typing",
      "GitLab/typing/typing/user/method",
      "GitLab/typing/typing/user/class",
      "GitLab/typing/typing/user/lambda",
      "GitLab/typing/typing/parser/method",
      "GitLab/typing/typing/parser/class",
      "GitLab/typing/typing/parser/class_array",
      "GitLab/typing/typing/parser/class_assoc",
      "GitLab/typing/typing/parser/newline_class_body",
      "GitLab/typing/typing/parser/newline_class_array",
      "GitLab/typing/typing/parser/newline_class_method",
    ],
    aliases: [
      "Ruby assoc with map",
      "RBS method",
      "User Model Method (GL)",
      "User Model Class (GL)",
      "User Model Lambda (GL)",
      "Parser Method",
      "Parser Class",
      "Parser Array",
      "Parser Assoc",
      "Parser Class (new line)",
      "Parser Array (new line)",
      "Parser Method (new line)",
    ],
  },
  {
    labels: ["Inspections"],
    measures: ["globalInspections"],
    projects: [
      "diaspora-project-inspections-test/inspection-RubyResolve-app",
      "diaspora-project-inspections-test/inspection-app",
      "gitlab-project-inspections-test/inspection-RubyResolve-app",
      "gitlab-project-inspections-test/inspection-app",
      "gitlab-project-inspections-test/inspection-App-RubyResolve",
      "gitlab-project-inspections-test/inspection-App",
      "redmine-project-inspections-test/inspection-RubyResolve-app",
      "redmine-project-inspections-test/inspection-app",
      "mastodon-project-inspections-test/inspection-RubyResolve-app",
      "mastodon-project-inspections-test/inspection-app",
    ],
    aliases: [
      "Unresolved References Inspection (DI)",
      "All Inspections (DI)",
      "Unresolved References Inspection (GL)",
      "All Inspections (GL)",
      "Unresolved References Inspection (GL)",
      "All Inspections (GL)",
      "Unresolved References Inspection (RM)",
      "All Inspections (RM)",
      "Unresolved References Inspection (MN)",
      "All Inspections (MN)",
    ],
  },
  {
    labels: ["Gitlab Inspections"],
    measures: ["globalInspections"],
    projects: [
      "gitlab-project-inspections-test/inspection-App",
      "gitlab-project-inspections-test/inspection-App-RubyResolve",
      "gitlab-project-inspections-test/inspection-Yaml",
      "gitlab-project-inspections-test/inspection-XML",
      "gitlab-project-inspections-test/inspection-WebStorm-AppSpecFrontend",
      "gitlab-project-inspections-test/inspection-Slim",
      "gitlab-project-inspections-test/inspection-RubyMine-App",
      "gitlab-project-inspections-test/inspection-Others",
      "gitlab-project-inspections-test/inspection-Markdown",
      "gitlab-project-inspections-test/inspection-Liquid",
      "gitlab-project-inspections-test/inspection-Haml",
      "gitlab-project-inspections-test/inspection-Erb",
      "gitlab-project-inspections-test/inspection-DataGrip",
    ],
    aliases: [
      "All (app/)",
      "Unresolved Ruby References (app/)",
      "Yaml",
      "XML",
      "All on WebStorm files (app/ & spec/frontend)",
      "Slim",
      "All on RubyMine files (app/)",
      "All on all other files",
      "Markdown",
      "Liquid",
      "Haml",
      "Erb",
      "All on DataGrip files",
    ],
  },
]

const charts = combineCharts(chartsDeclaration)
</script>
